package com.cloudree.gllib.constants;

import android.opengl.GLES20;

import com.cloudree.gllib.bean.FilterBean;

import java.util.ArrayList;

/**
 * Created by Administrator on 2017/8/8.
 */
public class Filter {
    /**
     * min filter
     */
    public static final String[] MIN_FILTER_NAME = {
            "GL_NEAREST",
            "GL_LINEAR",
            "GL_NEAREST_MIPMAP_NEAREST",
            "GL_NEAREST_MIPMAP_LINEAR",
            "GL_LINEAR_MIPMAP_NEAREST",
            "GL_LINEAR_MIPMAP_LINEAR"
    };
    public static final int[] MIN_FILTER_ID = {
            GLES20.GL_NEAREST,
            GLES20.GL_LINEAR,
            GLES20.GL_NEAREST_MIPMAP_NEAREST,
            GLES20.GL_NEAREST_MIPMAP_LINEAR,
            GLES20.GL_LINEAR_MIPMAP_NEAREST,
            GLES20.GL_LINEAR_MIPMAP_LINEAR
    };

    /**
     * mag Filter
     */
    public static final String[] MAG_FILTER_NAME = {
            "GL_NEAREST",
            "GL_LINEAR",
    };
    public static final int[] MAG_FILTER_ID = {
            GLES20.GL_NEAREST,
            GLES20.GL_LINEAR,
    };

    public static ArrayList<FilterBean> minFilters() {
        ArrayList<FilterBean> list = new ArrayList<>();
        for (int i = 0; i < MIN_FILTER_NAME.length; i++) {
            FilterBean bean = new FilterBean();
            bean.setName(MIN_FILTER_NAME[i]);
            bean.setId(MIN_FILTER_ID[i]);
            list.add(bean);
        }
        return list;
    }

    public static ArrayList<FilterBean> magFilters() {
        ArrayList<FilterBean> list = new ArrayList<>();
        for (int i = 0; i < MAG_FILTER_NAME.length; i++) {
            FilterBean bean = new FilterBean();
            bean.setName(MAG_FILTER_NAME[i]);
            bean.setId(MAG_FILTER_ID[i]);
            list.add(bean);
        }
        return list;
    }
}
